/**
 * Coryright 2015-2020 www.eyaomall.cn
 * All rights reserved.
 * @author huwenqing
 * @date 2016年9月20日
 *
 */
package com.eyaomall.wxmall.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.eyaomall.wxmall.common.helper.MemberHelper;
import com.eyaomall.wxmall.dao.AdvertDao;
import com.eyaomall.wxmall.model.po.Advert;
import com.eyaomall.wxmall.service.AdvertService;
import com.lycheeframework.core.cmp.kit.PageHTTPObject;
import com.lycheeframework.core.cmp.kit.Pages;

@Service
public class AdvertServiceImpl implements AdvertService {

	@Autowired
	private AdvertDao advertDao;

	/**
	 * 查询advert对象
	 */
	@SuppressWarnings("unchecked")
	public List<Advert> listPage(String type) {
		Advert advert = new Advert();
		advert.setShopId(MemberHelper.getShopId());
		advert.setType(type);
		
		return advertDao.list(advert);
	}
	
	/**
	 * 查询advert对象
	 */
	@SuppressWarnings("unchecked")
	public List<Advert> listPage() {
		Advert advert = new Advert();
		advert.setShopId(MemberHelper.getShopId());
		
		return advertDao.list(advert);
	}

	/**
	 * 页面数据
	 */
	public Pages<?> page(Advert advert, PageHTTPObject pageHTTPObject) {
		
		advert.setShopId(MemberHelper.getShopId());
		return advertDao.page(advert, pageHTTPObject);
	}

}
